<script type="text/javascript">

function submit_browse_form()
{
form1.submit();
}
</script>
<html>
<body>

<form action="" method="post" enctype="multipart/form-data" name="form1">

<input type="file" name="file" id="file" onclick="return submit_browse_form();" /> 
<inpUT type="hidden" name="sahara">

</form>

</body>
</html>


<?php
if(isset($_POST['sahara']))
{
if ($_FILES["file"]["error"] > 0)
  {
  echo "Error: " . $_FILES["file"]["error"] . "<br />";
  }
else
  {
  $file_name = $HTTP_POST_FILES['file']['name'];
  echo "File name now-".$file_name."<br/>";
  echo "Upload: " . $_FILES["file"]["name"] . "<br />";
  echo "Type: " . $_FILES["file"]["type"] . "<br />";
  echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
  echo "Stored in: " . $_FILES["file"]["tmp_name"];

  move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $_FILES["file"]["name"]);
      
  echo "Stored in: " . "upload/" . $_FILES["file"]["name"];

  }
}
?>